 <style type="text/css">
 #product_content{ height:auto;}
 .product_list{width:100%; height:100px; position:relative; word-wrap: break-word; margin:0 0 20px 0px;}
	.column_left{float:left; width:130px;}
		.product_image{float:left; width:130px; height:100px; overflow: hidden}
	.column_right{float:left; width:560px;}
		.product_title{float:left;}
		.product_detail{float:left;}
		.roduct_cart{float:left;}
		.product_price{float:left;}
.product-reccommend{ width:16px; height:15px; cursor:pointer;}


  div.loader {
      font-style: italic;
      text-align: center;
      margin: 20px;
      height: 24px;
      background: url(http://msjolund.github.com/autobrowse/loader.gif) no-repeat center center;
  }
 </style>
<!-- script type="text/javascript" src="modules/IShopStore/pnjavascript/infinite-scroll/jquery-1.4.2.min.js"></script -->
<!-- script type="text/javascript" src="modules/IShopStore/pnjavascript/jbasket/js/custom.js"></script -->
<script type="text/javascript" src="modules/IShopStore/pnjavascript/infinite-scroll/jquery.esn.autobrowse.js"></script>
<script type="text/javascript" src="modules/IShopStore/pnjavascript/infinite-scroll/jquery.json-2.2.min.js"></script>
<script type="text/javascript" src="modules/IShopStore/pnjavascript/infinite-scroll/jstorage.js"></script>

<!-- link rel="stylesheet" type="text/css" media="all" href="modules/IShopStore/pnjavascript/infinite-scroll/infinite-scroll.css" -->   
 
<script type="text/javascript">
    $(function () {
    
        $("#clear_cache").click( function (e) {
            e.preventDefault();
            $('.product_content .jp-container').autobrowse('flush');
        })

        $("#product_content #jp-container").autobrowse(
            {
                url: function (offset)
                {
                    //alert(offset );
                    //return "http://twitter.com/status/user_timeline/ParisHilton.json?count=10&page=OFFSET&callback=?".replace(/OFFSET/, 1+Math.round(offset/10));
                      var page = 1+Math.round(offset/10);
                      //alert(offset);                      
                      return "index.php?module=IShopStore&type=ajax&func=listJSON&start="+offset+"&order=id";
                },
                template: function (response)
                {

                
                    $.get('modules/IShopStore/pnjavascript/jbasket/js/custom.js', function(data) {
                      $('#button_cart').html(data);
                    });     
                             
                    var markup='';
                    for (var i=0; i<response.length; i++)
                    { 
                    
                        /*
                        markup += '<div class="tweet">';
                        markup += '<img src="http://localhost/iclient/'+response[i].firstthumbname+'">';                            
                        markup += '<p><strong>' + response[i].item_ref_id+ ' : </strong>';
                        markup += '<p><strong>' + response[i].title + '</strong><br>';
                        markup += response[i].detail;
                        markup += '</p><div style="clear: both;"></div></div>';
                        */
              
                        
                        markup += '<div class="product_list">';
                        markup += '  <div class="column_left productWrap">';
                        markup += '      <div class="product_image productImageWrap" id="productImageWrapID_list_' + response[i].id+ '">';
                        markup += '        <a href="<!--[pnmodurl modname="IShopStore" func="view" ctrl="item" id="' + response[i].id+ '"]-->">';
                        markup += '          <img src="<!--[pngetbaseurl]-->'+response[i].firstthumbname+'" width="130px" alt="Product' + response[i].id+ '"/>';
                        
                        //Check recommend
                        if(response[i].status == "9"){                    
                          markup += '            <div class="product-reccommend" onclick="location.href=\'<!--[pnmodurl modname="IShopStore" func="status" ctrl="Item" id="' + response[i].id+ '" status="9"]-->\';">';
                          markup += '            </div>';                        
                        }
                        markup += '        </a>';
                        markup += '      </div>';
                        markup += '  </div>';
                        
                        markup += '  <div class="column_right">';
                        markup += '      <div class="product_title">';
                        markup += '      <h1>';
                        markup += '        <a href="<!--[pnmodurl modname=IShopStore func=view ctrl=item id="' + response[i].id+ '"]-->'+'">';
                        markup += '          <div id="productTitle_list_' + response[i].id+ '" style="display:none;">' + response[i].title + '</div>';						  
                        markup += '           '+ response[i].title;
                        markup += '        </a>';
                        markup += '      </h1>';
                        markup += '      </div>';
                        markup += '      <div class="product_detail">';
                        markup += '      <p>' + response[i].detail + '</p>';
                        markup += '      </div>';
                        markup += '      <div class="product_cart"></div>';
                        markup += '      <div class="product_price">';
                        markup += '        <span>ราคา</span>';
                        markup += '        <span >&nbsp;' + response[i].price + '&nbsp;</span>';
                        markup += '        <div id="price_list_' + response[i].id+ '" style="display:none;">' + response[i].price + '</div>';			
                        markup += '        <span>บาท</span>';                                  
                        markup += '      </div>';                              
                        markup += '      <div class="productPriceWrapRight">';
                        markup += '        <a href="<!--[pnmodurl modname=IShopStore type=ajax func=addToCart id="' + response[i].id+ '"]-->'+'" onClick="return false;">';
                        markup += '          <button class="button_cart" alt="Add To Basket" id="featuredProduct_list_' + response[i].id+ '">หยิบใส่ตะกร้า</button>';
                        markup += '        </a>';
                        markup += '      </div>';											
                        markup += '  </div>';
                        markup += '</div>';                        
                    }
                    
                    return markup;
                },
                itemsReturned: function (response) { return response.length; },
                max: null,
                sensitivity: 1,
                finished: function () { $(this).append('<p style="text-align:center">ไม่มีข้อมูลแล้ว</p>') }
            }
        );
    });
</script>    





<div id="product_content">
	<h4>รายการสินค้าทั้งหมด</h4>
	<div id="jp-container" class="jp-container">
	
	</div>
</div>
<!--
<div class="page">
    <div style="clear: both;"></div>
    <h2>Infinite Scroll</h2>
    <div class="items">
    </div>
    <br>
    <a href="#clearcache" id="clear_cache">Clear cache</a>

</div>
!-->

